<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script>
window.onload = function(){
	var div = document.getElementsByTagName("div")[0];
    div.style.width = "100px";			// 设置元素的宽度
    var w = div.style.width; 			// 获取元素的宽度，返回字符串"100px"

	alert(w);
}
</script>
</head>
<body>
<div id="div" style="width:200px;border-style:solid;"></div>
</body>
</html> 
